<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Function Learning2</title>
    <script>
        'use strict'
        function add(a, b, f) {
            return f(a) + f(b);
        }
        var a = add(-3, 4, Math.abs);
        console.log(a);



        function product(arr) {
            arr.reduce(function (x, y) {
                var sum = x + y;
                return sum;
            });
        }

        var num = product([2, 3, 4, 5, 6, 9]);
        console.log(num);


        function string2int(s) {
                s.reduce(function(x,y){
            return 13579%10;

        });
        }

        console.log(string2int(1559));
    </script>
</head>

<body>

</body>

</html>